package com.mightybird.designpattern.structural.composite.safe;

import java.util.ArrayList;

public abstract class SafeContainer extends SafeComponent {
    protected ArrayList<SafeComponent> children = new ArrayList<>();

    public void add(SafeComponent safeComponent) {
        children.add(safeComponent);
    }

        public void remove(SafeComponent safeComponent) {
        children.remove(safeComponent);
    }

    public SafeComponent getChild(int i) {
        return children.get(i);
    }

}
